package cn.smbms.lan_han_mo_shi;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class LanHanMoShi {
	
private static LanHanMoShi hanMoShi;
	
	//把构造器设置为私有，防止程序员new出对象
	private LanHanMoShi(){}
	/*
	 * 
	 * 懒汉模式
	 * 类加载快但创建对象慢，需调用时获取
	 * 线程不安全
	 * 有延迟性
	 */
	public static synchronized LanHanMoShi getConnection(){
		if(hanMoShi==null){
			
			hanMoShi=new LanHanMoShi();
		}
		return hanMoShi;
	
	}
	
}
